//
//  AppDelegate+RootController.m
//  FreshMember
//
//  Created by qyc on 2019/4/8.
//  Copyright © 2019年 qyc. All rights reserved.
//

#import "AppDelegate+RootController.h"
#import "TabBarController.h"
#import "NavigationController.h"
#import "UserLoginViewController.h"
#import "HAHomeViewController.h"
#import "IQKeyboardManager.h"

@implementation AppDelegate (RootController)

/**
 *  自定义登录
 */
- (void)setCustomLogin {
    
    //先判断是否登陆
    if ([[ReadWriteUserInfoTool sharedUserInfo] isLogged]) {
        NavigationController *nav = [[NavigationController alloc] init];
        // 创建控制器
        HAHomeViewController *vc = [[HAHomeViewController alloc] init];
        [nav setViewControllers:@[vc] animated:YES];
        
        self.window.rootViewController = nav;
        
    } else {
        UserLoginViewController *login = [[UserLoginViewController alloc]init];
        self.window.rootViewController = login;
    }
}

/**
 键盘管理
 */
- (void)setKeyboardManager {
    [IQKeyboardManager sharedManager].enableAutoToolbar = NO;
    [IQKeyboardManager sharedManager].shouldResignOnTouchOutside = YES;
}

@end
